package com.lanou.student.page;

import java.util.Scanner;

import com.lanou.student.controller.UserController;

public class Project {
	private Regester regester;
	private Login login;
	private Reset reset;
	
	public Project(UserController userController) {
		regester = new Regester(userController);
		login = new Login(userController);
		reset = new Reset(userController);
	}

	public void start() {
		Scanner scanner = new Scanner(System.in);
		while (true) {
			System.out.println("=========学生信息管理系统=========");
			System.out.println("\t(1)、登录\t(2)、注册");
			System.out.println("\t(3)、忘记密码\t(4)、退出");
			System.out.println("\t\t请选择");
			switch (scanner.nextInt()) {
			case 1:
				//登录
				login();
				break;
			case 2:
				if(regester.regester()) {
					login.login();
				}else {
					System.out.println("注册失败");
				}
				//注册
				break;
			case 3:
				//忘记密码
				if(reset.resetPassword()) {
					login.login();
				}else {
					System.out.println("重置失败");
				}
				break;
			case 4:
				System.exit(0);
				break;

			default:
				System.out.println("你选择有误，请重新选择");
				break;
			}
		}

		//打印所有用户信息
		//添加 
		//更新 
		//删除 通过用户名删除
		//通过用户去查
		//注销
	}

	public void login() {
		login.login();
		
	}
  
}
